import Adafruit_DHT

def getDHT11(gpio):
    # 设置DHT11连接到的GPIO引脚
    gpio_pin = gpio

    # 设置传感器类型为DHT11
    sensor_type = Adafruit_DHT.DHT11

    # 读取传感器数据
    humidity, temperature = Adafruit_DHT.read_retry(sensor_type, gpio_pin)
    return humidity, temperature
